<?php

namespace App\Models;

use App\MenuType;
use Illuminate\Database\Eloquent\Model;

class Permission extends Core
{
    const TABLE = 'permissions';
    protected $table = self::TABLE;

    public function scopeManagerAvailable($query){

        return $query->where('type',MenuType::$Manager['code']);

    }

    public function scopeShopAvailable($query){

        return $query->where('type',MenuType::$Shop['code']);

    }

    public function scopeUserAvailable($query){

        return $query->where('type',MenuType::$User['code']);

    }

    public function scopeRecursionAvailable($query){

    }
}
